package com.tmall.qatest.service.impl;

import com.taobao.hsf.notify.client.NotifyManager;
import com.taobao.hsf.notify.client.SendResult;
import com.taobao.hsf.notify.client.message.Message;
import com.tmall.qatest.domain.Wood;
import com.tmall.qatest.service.NotifySenderService;

import javax.annotation.Resource;

/**
 * Created with IntelliJ IDEA.
 * User: Shuffle
 * Date: 13-1-31
 * Time: 下午4:45
 * To change this template use File | Settings | File Templates.
 */
public class NotifySenderServiceImpl implements NotifySenderService {
    @Resource
    protected NotifyManager notifyManager;
    @Override
    public SendResult fireWood(Wood wood) {
        Message message = wood.prepareWood();
        message.setMessageType(wood.getWoodType());
        return notifyManager.sendMessage(message);
    }
}